https://leetcode.cn/problems/basic-calculator-ii/description/
class Solution {
public:
    int calculate(string s) {
        vector<int> st(s.size());
        char oper='+';
        int tmp=0,i=0,n=s.size();
        //默认为正号
        while(i<n)
        {
            //空格就往后
            if(s[i]==' ')   ++i;
            else if(s[i]>='0'&&s[i]<='9')
            {
                //处理数字
                int tmp=0;
                while(i<n&&s[i]>='0'&&s[i]<='9')
                {
                    tmp=tmp*10;
                    tmp+=s[i++]-'0';
                }
                //把数字放到栈上
                //处理
                if(oper=='+')
                    st.push_back(tmp);
                else if(oper=='-')
                    st.push_back(-tmp);
                else if(oper=='*')
                    st.back()*=tmp;
                else
                    st.back()/=tmp;
            }
            else
                oper=s[i++];
        }
        int sum=0;
        for(auto x:st)
            sum+=x;
        return sum;
    }
};